﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IService.Utility;
using IService.DataDLL.Utility;

namespace IService
{
    public partial class MainContent : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                Model.User userSession = SessionState.CurrentUser;
                if (userSession.UserName == null)
                {
                    string LoginPage = StringUtil.GetAppConfigString("UserLoginPage");
                    Response.Redirect(LoginPage);
                }
                
            }
        }

        public int RequestType
        {
            get
            {
                try
                {
                    return Convert.ToInt32(base.Request["RequestType"]);
                }
                catch
                {
                    return 1;
                }
            }
        }

        /// <summary>
        /// 退出
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void lbtLogout_Click(object sender, EventArgs e)
        {
            SessionState.CurrentUser = null;
            Response.Redirect("~/index.aspx");
        }

        

    }
}